//
//  SmallKonwledgeViewController.m
//  MyProject
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 蓝鸥0825. All rights reserved.
//


//      小知识页面
#import "SmallKonwledgeViewController.h"
#import "SmallKnowledgeCollectionView.h"
#import "WHZAfnetWorking.h"

//      model 类
#import "CanModel.h"

//      小知识二级页面
#import "SmallSecViewController.h"


#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface SmallKonwledgeViewController ()

@end

@implementation SmallKonwledgeViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    
    
    SmallKnowledgeCollectionView *viewSmall = [[SmallKnowledgeCollectionView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    [self.view addSubview:viewSmall];
    viewSmall.VC = self;
    
    
    //      早餐页面的数据解析
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/tj_3can.php?format=jsonlat=&lon=&source=iphone&format=json&sort=default&t=zao&kw=&gy=&step=&mt=&page=1" WithParameters:nil Block:^(id result) {
        
        NSDictionary *dic = [NSDictionary dictionary];
        dic = result;
        self.arrZao = [CanModel baseModelByArr:dic[@"data"]];
        viewSmall.arrZao = self.arrZao;
    }];
    
    
    //      午餐页面的数据解析
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/tj_3can.php?format=jsonat=&lon=&source=iphone&format=json&sort=default&t=zhong&kw=&gy=&step=&mt=&page=1" WithParameters:nil Block:^(id result) {
        NSDictionary *dic = [NSDictionary dictionary];
        dic = result;
        self.arrWu = [CanModel baseModelByArr:dic[@"data"]];
        viewSmall.arrWu = self.arrWu;
    }];
    
    
    //      下午茶页面的数据解析
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/tj_3can.php?format=jsonat=&lon=&source=iphone&format=json&sort=default&t=xiawucha&kw=&gy=&step=&mt=&page=1" WithParameters:nil Block:^(id result) {
        NSDictionary *dic = [NSDictionary dictionary];
        dic = result;
        self. arrXiaWuCha = [CanModel baseModelByArr:dic[@"data"]];
        viewSmall.arrXiaWuCha = self.arrXiaWuCha;
    }];
    
    
    
    //      晚餐页面的数据解析
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/tj_3can.php?format=jsonat=&lon=&source=iphone&format=json&sort=default&t=wan&kw=&gy=&step=&mt=&page=1" WithParameters:nil Block:^(id result) {
        NSDictionary *dic = [NSDictionary dictionary];
        dic = result;
        self. arrWan = [CanModel baseModelByArr:dic[@"data"]];
        viewSmall.arrWan = self.arrWan;
    }];
    
    
    //      夜宵页面的数据解析
    [WHZAfnetWorking GETJRAfnNetworkingWithUrl:@"http://api.meishi.cc/v5/tj_3can.php?format=jsonat=&lon=&source=iphone&format=json&sort=default&t=yexiao&kw=&gy=&step=&mt=&page=1" WithParameters:nil Block:^(id result) {
        NSDictionary *dic = [NSDictionary dictionary];
        dic = result;
        self. arrYeXiao = [CanModel baseModelByArr:dic[@"data"]];
        viewSmall.arrYeXiao = self.arrYeXiao;
    }];
    

    
    
    
    
    
}






- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}




@end
